Skip to content

[AURON #2732] support platform option in Docker build mode#2371

Open
zhaohehuhu wants to merge 1 commit into
apache:masterfrom
zhaohehuhu:dev-0702
Open

[AURON #2732] support platform option in Docker build mode#2371
zhaohehuhu wants to merge 1 commit into
apache:masterfrom
zhaohehuhu:dev-0702

Conversation

@zhaohehuhu

@zhaohehuhu zhaohehuhu commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #2372

Rationale for this change

Docker build mode needs a way to specify the Docker platform from auron-build.sh, especially on ARM hosts where release builds may need to run as linux/amd64.

What changes are included in this PR?

as title

Are there any user-facing changes?

no

How was this patch tested?

rebuild auron with docker mode

@zhaohehuhu zhaohehuhu changed the title Support platform option in Docker build mode [AURON #2732] Support platform option in Docker build mode Jul 2, 2026
@zhaohehuhu zhaohehuhu changed the title [AURON #2732] Support platform option in Docker build mode [AURON #2732] support platform option in Docker build mode Jul 2, 2026
@wForget

wForget commented Jul 2, 2026

Copy link
Copy Markdown
Member

Docker build mode needs a way to specify the Docker platform from auron-build.sh, especially on ARM hosts where release builds may need to run as linux/amd64.

Do you mean building an amd64/x86_64 package on an arm64/aarch64 machine? I'm not sure if there will be any problems with that.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for selecting a Docker target platform when building Auron in Docker mode, which is especially useful on ARM hosts that need to build linux/amd64 artifacts.

Changes:

  • Adds a --platform option to auron-build.sh and exports it via AURON_DOCKER_PLATFORM.
  • Wires the exported platform into the Docker Compose service via the platform: field.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
dev/docker-build/docker-compose.yml Uses AURON_DOCKER_PLATFORM to set the Compose service platform (with a default).
auron-build.sh Adds --platform CLI parsing/validation and exports AURON_DOCKER_PLATFORM for Docker builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread auron-build.sh
# -----------------------------------------------------------------------------
USE_DOCKER=false
IMAGE_NAME="${SUPPORTED_OS_IMAGES[*]:0:1}"
DOCKER_PLATFORM="$DEFAULT_DOCKER_PLATFORM"
Comment thread auron-build.sh
echo " --skiptests <true|false> Skip unit tests (default: true)"
echo " --sparktests <true|false> Run spark tests (default: false)"
echo " --docker <true|false> Build in Docker environment (default: false)"
echo " --platform <PLATFORM> Docker platform to use (default: linux/amd64)"
@zhaohehuhu

Copy link
Copy Markdown
Contributor Author

Docker build mode needs a way to specify the Docker platform from auron-build.sh, especially on ARM hosts where release builds may need to run as linux/amd64.

Do you mean building an amd64/x86_64 package on an arm64/aarch64 machine? I'm not sure if there will be any problems with that.

Correct. I am trying to build an amd64 package on my local Mac.

@wForget

wForget commented Jul 6, 2026

Copy link
Copy Markdown
Member

Correct. I am trying to build an amd64 package on my local Mac.

Does the package you built on your mac run correctly on an amd64 machine? I generally recommend building and running on a consistent CPU architecture to avoid unforeseen crashes, although I'm not sure if specifying the docker platform will prevent them.

@zhaohehuhu

zhaohehuhu commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Correct. I am trying to build an amd64 package on my local Mac.

Does the package you built on your mac run correctly on an amd64 machine? I generally recommend building and running on a consistent CPU architecture to avoid unforeseen crashes, although I'm not sure if specifying the docker platform will prevent them.

Yes, Auron has been working well so far. @wForget

@weiqingy weiqingy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on. The title says [AURON #2732], but the PR closes #2372 — the digits look transposed, and #2732 doesn't exist. Since Auron squash-merges and the PR title becomes the commit subject on master, the wrong number would stick in history. (pr-title-check.yml only validates the shape [AURON #<digits>], so CI won't flag it.)


services:
build-release:
platform: ${AURON_DOCKER_PLATFORM:-linux/amd64}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is also the answer to the amd64-on-ARM question raised in the thread, I think. Every build image installs an x86_64 Rust toolchain (--default-toolchain nightly-2025-05-09-x86_64-unknown-linux-gnu, in all five Dockerfiles), and docker-compose.yml:34 pins RUSTFLAGS: "-C target-cpu=skylake" unconditionally. So with platform: linux/amd64 it's an x86_64 rustc, running under emulation, emitting x86_64/Skylake codegen — the artifact should be the one a native amd64 host would produce, not an arm64 binary. Emulation costs build time, not correctness.

Worth noting the converse too: without this line, an arm64 host builds arm64 base images and then installs an x86_64 rustc it can't execute. So this looks less like "let me cross-build" and more like a fix for Docker mode on ARM hosts — which might be worth saying in the PR description, since it currently says there are no user-facing changes.

That's from reading the images rather than running the build, so worth a sanity check.

Comment thread auron-build.sh
--platform)
if [[ -n "$2" && "$2" != -* ]]; then
DOCKER_PLATFORM="$2"
if [[ ! "$DOCKER_PLATFORM" =~ ^[a-z0-9_.-]+/[a-z0-9_.-]+(/[a-z0-9_.-]+)?$ ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the x86_64-only images, --platform linux/arm64 passes this regex and then fails deep inside the image build — ubuntu24/debian11 hard-code JAVA_HOME=/usr/lib/jvm/java-*-openjdk-amd64 — with an error pointing nowhere near the flag.

Which raises the question I keep circling: if linux/amd64 is the only platform these images can build, the flag's one legal value is also its default. Is arm64 meant to work eventually — in which case the Dockerfiles need an arch-aware toolchain and JAVA_HOME, and RUSTFLAGS can't stay pinned to skylake? Or is amd64 the only supported target, in which case would the compose default alone be enough, without the flag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support platform option in Docker build mode

4 participants